rgbFLOUR = [217 166 162; 202 160 158; 182 140 140; 151 111 110; 107 74 72; 54 40 28; 18 29 85; 83 118 66; 232 0 0; 255 173 18; 255 48 122; 52 148 176; 206 50 0; 68 59 116; 232 20 32; 118 30 74; 195 173 78; 255 141 0; 100 23 12; 193 87 75; 96 93 112; 97 84 35; 156 109 142; 131 171 160];
rgbTUNGSTEN = [167 172 176; 151 158 164; 129 136 142; 98 105 113; 63 72 75; 24 26 25; 8 27 101; 40 106 64; 153 8 11; 197 173 24; 176 68 132; 18 132 195; 142 63 0; 29 58 136; 158 40 57; 64 35 82; 137 162 67; 193 142 0; 44 25 13; 132 92 89; 49 88 127; 50 75 33; 100 104 152; 83 159 165];
rgbDAYLIGHT = [218 174 125; 202 162 117; 180 145 100; 144 113 75; 107 79 40; 49 32 16; 25 25 51; 89 119 31; 217 13 0; 255 187 0; 240 72 90; 69 140 135; 195 74 0; 73 60 85; 220 51 25; 114 36 42; 192 177 27; 255 157 0; 97 31 6; 191 101 49; 99 95 84; 100 92 17; 155 111 108; 141 170 122];

graysDAY=rgbDAYLIGHT(1:6,:);
intensity=0:1/5:1;
fb1=graysDAY(:,1)/max(graysDAY(:,1));
fb1=flipud(fb1);
handle=plot(intensity,fb1);
set(handle,'Color','b','Linewidth',4)
prediction = intensity.^(1/2.2);
hold on
handle2=plot(intensity,prediction,'r-.')
set(handle2,'Color','r','Linewidth',3)
prediction = intensity.^(1/2.5);
handle3=plot(intensity,prediction,'g-.')
set(handle3,'Color','g','Linewidth',3)
prediction = intensity.^(1/2.3);
handle4=plot(intensity,prediction,'m-.')
set(handle4,'Color','m','Linewidth',3)
grid on
title('Gamma Estimation for Camera with Daylight Setting')
xlabel('Intensity')
ylabel('Frame Buffer Level')
legend('data from camera', 'gamma=2.2', 'gamma=2.5', 'gamma=2.3')
